package com.fz.mapper;

import com.fz.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * Created by webrx on 2017-08-24.
 */
public interface StudentMapper {
    public List<Student> queryall();
    public int deleteById(int id);

    @Select("select * from db_student where name like #{name}")
    public List<Student> queryByName(String n);

    //@Insert("insert into db_student values(null,#{0},#{1},#{2})")
    public int add(String name,int score,String address);


    @Select("select count(*) from db_student")
    public int count();

    @Delete("delete from db_student where 1=1")
    public int deleteAll();

    @Select("select name,score from db_student where id=#{id}")
    public Map<String,Object> showById(int id);

    @Select("select name,score from db_student where id=#{id}")
    public Student sById(int id);

    @Select("select name,score from db_student where 1=1")
    public List<Map<String,Object>> show();
}
